﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using AR.Entities;
using AR.ViewModels;

namespace AR.Views.Candidat
{
    public partial class InformationsCandidat : ChildWindow
    {
        // InformationsCandidatViewModel viewModel;
        public string _nomCandidat;

        public InformationsCandidat()
        {

            InitializeComponent();
            // Loaded += new RoutedEventHandler(ChildWindow_Loaded);

        }
        public CANDIDAT candidat{get;set;}
        public InformationsCandidat(CANDIDAT candidat)
        {
            this.candidat = candidat;
            InitializeComponent();
            txt_nom.Text= candidat.NOM;
            txt_prenom.Text= candidat.PRENOM;
            txt_ddn.Text = candidat.DATENAISSANCE.ToString().Substring(0, 10);
            txt_sal.Text = candidat.SALAIRE_ACTUELLE.ToString();
            txt_sal_dem.Text = candidat.SALAIRE_DEMANDE.ToString();
            txtniv_etd.Text = candidat.NIVEAU_ETUDE.INTITULE;
            txtniv_exp.Text = candidat.NIVEAU_EXPERIENCE.INTITULE +" ans";
            txt_gcm_RH.Text= candidat.GCM_ESTIMEE_RH.ToString();
            txt_tel.Text= candidat.TEL;
            txt_email.Text = candidat.EMAIL;
            txt_drn_emp.Text = candidat.DERNIER_EMPLOYEUR;


            // Loaded += new RoutedEventHandler(ChildWindow_Loaded);

        }
        void ChildWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // txt_email.Text = _nomCandidat;
        }

        private void visualiserClick(object sender, RoutedEventArgs e)
        {
            string relatifpath = System.Windows.Application.Current.Host.Source.AbsoluteUri.Replace("/ClientBin/AR.xap", "/AppData/CV/");
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(relatifpath+ candidat.CV), "_blank");

        }






    }
}

